-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finished #805
base: master
Are you sure you want to change the base?
Finished #805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Check some improvements that I find.
Many thanks!
src/errorHandler.js
Outdated
const isToCaseUnaccepted = | ||
toCase !== 'SNAKE' && | ||
toCase !== 'KEBAB' && | ||
toCase !== 'CAMEL' && | ||
toCase !== 'PASCAL' && | ||
toCase !== 'UPPER' && | ||
!isToCaseParamApsent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make array with all values, than use includes or something like that.
src/errorHandler.js
Outdated
message: | ||
'Text to convert is required. Correct request' + | ||
' is: "/<TEXT_TO_CONVERT>?toCase=<CASE_NAME>".', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All errorMessages can be constants
src/errorHandler.js
Outdated
); | ||
|
||
return true; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use only if block
src/req.js
Outdated
// const response = ''; | ||
|
||
res.on('data', (chunk) => { | ||
// response += chunk.toString() + '\n'; | ||
}); | ||
|
||
res.on('end', () => { | ||
// console.log('Response from server:', response); | ||
}); | ||
}); | ||
|
||
// req.on('error', (error) => { | ||
// console.log(error); | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented ( I see comment above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Approved.
Many thanks)
I'd appreciate some advices to code style and structure)